//
// Created by miaomiaole on 2023/5/21.
//

#ifndef CMAKECXX_SAMPLE_UNIQUE_PRT_H
#define CMAKECXX_SAMPLE_UNIQUE_PRT_H

#include <iostream>
#include <memory>

struct Sample {

    int content_;

    Sample(int content) : content_(content) {
        std::cout << "Constructing Sample(" << content_ << ")" << std::endl;
    }

    ~Sample() {
        std::cout << "Deleting Sample(" << content_ << ")" << std::endl;
    }
};

Sample & func_ref();

struct Sample_2 {
    int content_;
    std::unique_ptr<Sample> sample = std::make_unique<Sample>(200);

    Sample_2(int content = 1000) : content_(content) {
        std::cout << "Constructing Sample_2(" << content_ << ")" << std::endl;
    }

    ~Sample_2() {
        std::cout << "Deleting Sample_2(" << content_ << ")" << std::endl;
    }
};

template<typename T, template<typename U, typename V> class Arr>
class MyClass {
    T data;
    Arr<std::string, int> a;
};

template<typename T>
class Base {
    T data_sub;
};




void releas_unique_pointer();


void releas_unique_ptr();


void smart_pointer();


void time_time();


#endif //CMAKECXX_SAMPLE_UNIQUE_PRT_H
